<template>
	<view class="countdown-card" :class="!borderRadius?'no-border-radius':''">
		<view class="u-flex u-flex-column" @click="jump('/pages/examination/examination')">
			<view class="u-flex u-flex-start u-flex-items-end">
				<text class="days">{{ Math.abs(configInfo.caac_day) || '--'  }}<text class="unit">天</text></text>
			</view>
			<text class="desc">距离{{configInfo.caac_next_exam_time || '--'}}考试时间</text>
		</view>
		<view class="picker u-flex" @click="jump('/pages/index/chooseCourse')">
			<view class="picker-btn u-m-r-4 u-flex u-flex-center u-flex-items-center">
				<view class="u-m-r-6"> {{ examType }}</view>
				<!--<u-icon name="arrow-down" size="20" :color="'#fff'"></u-icon> -->
				<view class="picker-btn-down">
					<image :src="HTTP_IMG_URL()+'/static/images/arrow-down-white.png'" model="aspectFill"></image>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
export default {
	props: {
		configInfo: Object,
		examType: String,
		borderRadius: {
			type: Boolean,
			default: true
		}
	},
	data() {
		return {
			selectedTypeIdx: 0
		}
	},
	methods: {
		jump(e) {
			// console.log(uni.getStorageSync('examType'), '3333');
			const newValue = uni.getStorageSync('examType');
			uni.navigateTo({
				url: e + '?value=' + newValue
			})
		},
		HTTP_IMG_URL() {
			return this.$imgUrl;
		}
	}
}
</script>
<style scoped lang="scss">
.countdown-card {
	background: rgba(22,100,255,0.08);
	border-radius: 20rpx;
	padding: 24rpx 24rpx;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 20rpx 0;
}
.no-border-radius{
	border-radius: 0;
}
.days {
	color: #2563eb;
	font-size: 48rpx;
	font-weight: bold;
	margin-right: 12rpx;
}
.unit {
	font-size: 28rpx;
}
.picker {
	margin: 0 16rpx;
}
.picker-btn {
	background: #2563eb;
	color: #fff;
	border-radius: 24rpx;
	padding: 8rpx 24rpx;
}
.desc {
	color: #666;
	font-size: 24rpx;
	margin-top: 4rpx;
}
.picker-btn-down{
	width: 20rpx;
	height: 14rpx;
	margin-left: 18rpx;
	image{
		width: 100%;
		height: 100%;
		margin-bottom: 20rpx ;
	}
}
</style> 